# Maintainer: Eric Belanger <eric@archlinux.org>
# Contributor: Kritoke <typeolinux@yahoo.com>

pkgname=gnumeric
pkgver=1.12.56
pkgrel=1
pkgdesc="A GNOME Spreadsheet Program"
arch=('loong64' 'x86_64')
url="http://www.gnumeric.org/"
license=('GPL')
depends=('goffice')
makedepends=('intltool' 'psiconv' 'pygobject-devel' docbook-xml
             'gobject-introspection' 'python-gobject' gtk-doc yelp-tools)
optdepends=('python-gobject: for python plugin support'
            'perl: for perl plugin support'
            'psiconv: for Psion 5 file support'
            'yelp: for viewing the help manual')
source=(https://download.gnome.org/sources/gnumeric/1.12/gnumeric-$pkgver.tar.xz
        revert-warnings.patch)
sha256sums=('51a38f35ac5b0f71defa8b9e20bf2e08563798f1cb33379a9a17726fb1e3e1b2'
            'bcafca016b809000c2a5bf911e2e3dfa4de28f9e541d9964574cac5c7ce09e53')

prepare() {
  cd $pkgname-$pkgver
  patch -Np0 -i ../revert-warnings.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-schemas-compile --enable-introspection --disable-silent-rules

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
}
